package com.fangzhi.controller;

import com.fangzhi.mobel.vo.DeptListVo;
import com.fangzhi.mobel.vo.RoleListVo;
import com.fangzhi.service.DeptBaseInfoService;
import com.fangzhi.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private DeptBaseInfoService deptBaseInfoService;


    /**
     * 根据权限获取所有部门
     * @param deptId
     * @return
     */
    @RequestMapping("/deptList")
    public ResponseResult deptList(@RequestParam(defaultValue = "0") Integer deptId){
        List<DeptListVo> voList = deptBaseInfoService.deptList(deptId);
        return ResponseResult.OK(voList);
    }
}
